and remove some special-case code in the shadows.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
if ( !pg )
return -ENOMEM;
+
+ /* This page needs to look like a pagetable so that it can be shadowed */
+ pg->u.inuse.type_info = PGT_l4_page_table|PGT_validated;
+
l4tab = copy_page(page_to_virt(pg), idle_pg_table);
l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
l4e_from_page(pg, __PAGE_HYPERVISOR);
{
struct page_info *page = mfn_to_page(gmfn);
-#ifdef CONFIG_COMPAT
- if ( !IS_COMPAT(v->domain) || type != SH_type_l4_64_shadow )
-#endif
- ASSERT(test_bit(_PGC_page_table, &page->count_info));
-
+ ASSERT(test_bit(_PGC_page_table, &page->count_info));
ASSERT(test_bit(type, &page->shadow_flags));
clear_bit(type, &page->shadow_flags);
break;
case SH_type_l2h_64_shadow:
ASSERT( IS_COMPAT(v->domain) );
+ /* Fall through... */
case SH_type_l2_64_shadow:
SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 4, 4)(v, smfn);
break;
#if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
/* Once again OK to unhook entries from this table if we see fork/exit */
-#if CONFIG_PAGING_LEVELS == 4
- if ( IS_COMPAT(d) )
- ASSERT(!sh_mfn_is_a_page_table(gmfn));
- else
-#endif
- ASSERT(sh_mfn_is_a_page_table(gmfn));
+ ASSERT(sh_mfn_is_a_page_table(gmfn));
mfn_to_page(gmfn)->shadow_flags &= ~SHF_unhooked_mappings;
#endif
- /* Pin the shadow and put it (back) on the list of top-level shadows */
+ /* Pin the shadow and put it (back) on the list of pinned shadows */
if ( sh_pin(v, smfn) == 0 )
{
SHADOW_ERROR("can't pin %#lx as toplevel shadow\n", mfn_x(smfn));